package cn.jinjie.day05.test8;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Demo10 {
    public static void main(String[] args) {
        // 5、获取指定日期和时间的LocalDateTime对象：
        // public static LocalDateTime of(int year, Month month, int dayOfMonth, int hour,
        //                                  int minute, int second, int nanoOfSecond)
        LocalDateTime ldt8 = LocalDateTime.of(2029, 12, 12, 12, 12, 12, 1222);
        LocalDateTime ldt9 = LocalDateTime.of(2029, 12, 12, 12, 12, 12, 1222);
        System.out.println(ldt8);
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("y年M月d日 H:mm:ss");
        String format = now.format(dtf);
        System.out.println(format);
    }
}
